<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- /fasttmp/mkdist-qt-4.3.5-1211793125/qtopia-core-opensource-src-4.3.5/src/gui/painting/qpainterpath.cpp -->
<head>
  <title>Qt 4.3: QPainterPathStroker Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://www.trolltech.com/products/qt"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="modules.html"><font color="#004faf">Modules</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
<td align="right" valign="top" width="230"><a href="http://www.trolltech.com"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></a></td></tr></table><h1 align="center">QPainterPathStroker Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1>
<p>The QPainterPathStroker class is used to generate fillable outlines for a given painter path. <a href="#details">More...</a></p>
<pre> #include &lt;QPainterPathStroker&gt;</pre><p>This class was introduced in Qt 4.1.</p>
<ul>
<li><a href="qpainterpathstroker-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-functions"></a>
<h3>Public Functions</h3>
<ul>
<li><div class="fn"/><b><a href="qpainterpathstroker.html#QPainterPathStroker">QPainterPathStroker</a></b> ()</li>
<li><div class="fn"/><b><a href="qpainterpathstroker.html#dtor.QPainterPathStroker">~QPainterPathStroker</a></b> ()</li>
<li><div class="fn"/>Qt::PenCapStyle <b><a href="qpainterpathstroker.html#capStyle">capStyle</a></b> () const</li>
<li><div class="fn"/>QPainterPath <b><a href="qpainterpathstroker.html#createStroke">createStroke</a></b> ( const QPainterPath &amp; <i>path</i> ) const</li>
<li><div class="fn"/>qreal <b><a href="qpainterpathstroker.html#curveThreshold">curveThreshold</a></b> () const</li>
<li><div class="fn"/>qreal <b><a href="qpainterpathstroker.html#dashOffset">dashOffset</a></b> () const</li>
<li><div class="fn"/>QVector&lt;qreal&gt; <b><a href="qpainterpathstroker.html#dashPattern">dashPattern</a></b> () const</li>
<li><div class="fn"/>Qt::PenJoinStyle <b><a href="qpainterpathstroker.html#joinStyle">joinStyle</a></b> () const</li>
<li><div class="fn"/>qreal <b><a href="qpainterpathstroker.html#miterLimit">miterLimit</a></b> () const</li>
<li><div class="fn"/>void <b><a href="qpainterpathstroker.html#setCapStyle">setCapStyle</a></b> ( Qt::PenCapStyle <i>style</i> )</li>
<li><div class="fn"/>void <b><a href="qpainterpathstroker.html#setCurveThreshold">setCurveThreshold</a></b> ( qreal <i>threshold</i> )</li>
<li><div class="fn"/>void <b><a href="qpainterpathstroker.html#setDashOffset">setDashOffset</a></b> ( qreal <i>offset</i> )</li>
<li><div class="fn"/>void <b><a href="qpainterpathstroker.html#setDashPattern">setDashPattern</a></b> ( Qt::PenStyle <i>style</i> )</li>
<li><div class="fn"/>void <b><a href="qpainterpathstroker.html#setDashPattern-2">setDashPattern</a></b> ( const QVector&lt;qreal&gt; &amp; <i>dashPattern</i> )</li>
<li><div class="fn"/>void <b><a href="qpainterpathstroker.html#setJoinStyle">setJoinStyle</a></b> ( Qt::PenJoinStyle <i>style</i> )</li>
<li><div class="fn"/>void <b><a href="qpainterpathstroker.html#setMiterLimit">setMiterLimit</a></b> ( qreal <i>limit</i> )</li>
<li><div class="fn"/>void <b><a href="qpainterpathstroker.html#setWidth">setWidth</a></b> ( qreal <i>width</i> )</li>
<li><div class="fn"/>qreal <b><a href="qpainterpathstroker.html#width">width</a></b> () const</li>
</ul>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The QPainterPathStroker class is used to generate fillable outlines for a given painter path.</p>
<p>By calling the <a href="qpainterpathstroker.html#createStroke">createStroke</a>() function, passing a given <a href="qpainterpath.html">QPainterPath</a> as argument, a new painter path representing the outline of the given path is created. The newly created painter path can then be filled to draw the original painter path's outline.</p>
<p>You can control the various design aspects (width, cap styles, join styles and dash pattern) of the outlining using the following functions:</p>
<ul>
<li><a href="qpainterpathstroker.html#setWidth">setWidth</a>()</li>
<li><a href="qpainterpathstroker.html#setCapStyle">setCapStyle</a>()</li>
<li><a href="qpainterpathstroker.html#setJoinStyle">setJoinStyle</a>()</li>
<li><a href="qpainterpathstroker.html#setDashPattern">setDashPattern</a>()</li>
</ul>
<p>The <a href="qpainterpathstroker.html#setDashPattern">setDashPattern</a>() function accepts both a <a href="qt.html#PenStyle-enum">Qt::PenStyle</a> object and a vector representation of the pattern as argument.</p>
<p>In addition you can specify a curve's threshold, controlling the granularity with which a curve is drawn, using the <a href="qpainterpathstroker.html#setCurveThreshold">setCurveThreshold</a>() function. The default threshold is a well adjusted value (0.25), and normally you should not need to modify it. However, you can make the curve's appearance smoother by decreasing its value.</p>
<p>You can also control the miter limit for the generated outline using the <a href="qpainterpathstroker.html#setMiterLimit">setMiterLimit</a>() function. The miter limit describes how far from each join the miter join can extend. The limit is specified in the units of width so the pixelwise miter limit will be <tt>miterlimit * width</tt>. This value is only used if the join style is <a href="qt.html#PenJoinStyle-enum">Qt::MiterJoin</a>.</p>
<p>The painter path generated by the <a href="qpainterpathstroker.html#createStroke">createStroke</a>() function should only be used for outlining the given painter path. Otherwise it may cause unexpected behavior. Generated outlines also require the <a href="qt.html#FillRule-enum">Qt::WindingFill</a> rule which is set by default.</p>
<p>See also <a href="qpen.html">QPen</a> and <a href="qbrush.html">QBrush</a>.</p>
<hr />
<h2>Member Function Documentation</h2>
<h3 class="fn"><a name="QPainterPathStroker"></a>QPainterPathStroker::QPainterPathStroker ()</h3>
<p>Creates a new stroker.</p>
<h3 class="fn"><a name="dtor.QPainterPathStroker"></a>QPainterPathStroker::~QPainterPathStroker ()</h3>
<p>Destroys the stroker.</p>
<h3 class="fn"><a name="capStyle"></a><a href="qt.html#PenCapStyle-enum">Qt::PenCapStyle</a> QPainterPathStroker::capStyle () const</h3>
<p>Returns the cap style of the generated outlines.</p>
<p>See also <a href="qpainterpathstroker.html#setCapStyle">setCapStyle</a>().</p>
<h3 class="fn"><a name="createStroke"></a><a href="qpainterpath.html">QPainterPath</a> QPainterPathStroker::createStroke ( const <a href="qpainterpath.html">QPainterPath</a> &amp; <i>path</i> ) const</h3>
<p>Generates a new path that is a fillable area representing the outline of the given <i>path</i>.</p>
<p>The various design aspects of the outline are based on the stroker's properties: <a href="qpainterpathstroker.html#width">width</a>(), <a href="qpainterpathstroker.html#capStyle">capStyle</a>(), <a href="qpainterpathstroker.html#joinStyle">joinStyle</a>(), <a href="qpainterpathstroker.html#dashPattern">dashPattern</a>(), <a href="qpainterpathstroker.html#curveThreshold">curveThreshold</a>() and <a href="qpainterpathstroker.html#miterLimit">miterLimit</a>().</p>
<p>The generated path should only be used for outlining the given painter path. Otherwise it may cause unexpected behavior. Generated outlines also require the <a href="qt.html#FillRule-enum">Qt::WindingFill</a> rule which is set by default.</p>
<h3 class="fn"><a name="curveThreshold"></a><a href="qtglobal.html#qreal-typedef">qreal</a> QPainterPathStroker::curveThreshold () const</h3>
<p>Returns the curve flattening threshold for the generated outlines.</p>
<p>See also <a href="qpainterpathstroker.html#setCurveThreshold">setCurveThreshold</a>().</p>
<h3 class="fn"><a name="dashOffset"></a><a href="qtglobal.html#qreal-typedef">qreal</a> QPainterPathStroker::dashOffset () const</h3>
<p>Returns the dash offset for the generated outlines.</p>
<p>See also <a href="qpainterpathstroker.html#setDashOffset">setDashOffset</a>().</p>
<h3 class="fn"><a name="dashPattern"></a><a href="qvector.html">QVector</a>&lt;<a href="qtglobal.html#qreal-typedef">qreal</a>&gt; QPainterPathStroker::dashPattern () const</h3>
<p>Returns the dash pattern for the generated outlines.</p>
<p>See also <a href="qpainterpathstroker.html#setDashPattern">setDashPattern</a>().</p>
<h3 class="fn"><a name="joinStyle"></a><a href="qt.html#PenJoinStyle-enum">Qt::PenJoinStyle</a> QPainterPathStroker::joinStyle () const</h3>
<p>Returns the join style of the generated outlines.</p>
<p>See also <a href="qpainterpathstroker.html#setJoinStyle">setJoinStyle</a>().</p>
<h3 class="fn"><a name="miterLimit"></a><a href="qtglobal.html#qreal-typedef">qreal</a> QPainterPathStroker::miterLimit () const</h3>
<p>Returns the miter limit for the generated outlines.</p>
<p>See also <a href="qpainterpathstroker.html#setMiterLimit">setMiterLimit</a>().</p>
<h3 class="fn"><a name="setCapStyle"></a>void QPainterPathStroker::setCapStyle ( <a href="qt.html#PenCapStyle-enum">Qt::PenCapStyle</a> <i>style</i> )</h3>
<p>Sets the cap style of the generated outlines to <i>style</i>. If a dash pattern is set, each segment of the pattern is subject to the cap <i>style</i>.</p>
<p>See also <a href="qpainterpathstroker.html#capStyle">capStyle</a>().</p>
<h3 class="fn"><a name="setCurveThreshold"></a>void QPainterPathStroker::setCurveThreshold ( <a href="qtglobal.html#qreal-typedef">qreal</a> <i>threshold</i> )</h3>
<p>Specifies the curve flattening <i>threshold</i>, controlling the granularity with which the generated outlines' curve is drawn.</p>
<p>The default threshold is a well adjusted value (0.25), and normally you should not need to modify it. However, you can make the curve's appearance smoother by decreasing its value.</p>
<p>See also <a href="qpainterpathstroker.html#curveThreshold">curveThreshold</a>().</p>
<h3 class="fn"><a name="setDashOffset"></a>void QPainterPathStroker::setDashOffset ( <a href="qtglobal.html#qreal-typedef">qreal</a> <i>offset</i> )</h3>
<p>Sets the dash offset for the generated outlines to <i>offset</i>.</p>
<p>See also <a href="qpainterpathstroker.html#dashOffset">dashOffset</a>().</p>
<h3 class="fn"><a name="setDashPattern"></a>void QPainterPathStroker::setDashPattern ( <a href="qt.html#PenStyle-enum">Qt::PenStyle</a> <i>style</i> )</h3>
<p>Sets the dash pattern for the generated outlines to <i>style</i>.</p>
<p>See also <a href="qpainterpathstroker.html#dashPattern">dashPattern</a>().</p>
<h3 class="fn"><a name="setDashPattern-2"></a>void QPainterPathStroker::setDashPattern ( const <a href="qvector.html">QVector</a>&lt;<a href="qtglobal.html#qreal-typedef">qreal</a>&gt; &amp; <i>dashPattern</i> )</h3>
<p>This is an overloaded member function, provided for convenience.</p>
<p>Sets the dash pattern for the generated outlines to <i>dashPattern</i>. This function makes it possible to specify custom dash patterns.</p>
<p>Each element in the vector contains the lengths of the dashes and spaces in the stroke, beginning with the first dash in the first element, the first space in the second element, and alternating between dashes and spaces for each following pair of elements.</p>
<p>The vector can contain an odd number of elements, in which case the last element will be extended by the length of the first element when the pattern repeats.</p>
<h3 class="fn"><a name="setJoinStyle"></a>void QPainterPathStroker::setJoinStyle ( <a href="qt.html#PenJoinStyle-enum">Qt::PenJoinStyle</a> <i>style</i> )</h3>
<p>Sets the join style of the generated outlines to <i>style</i>.</p>
<p>See also <a href="qpainterpathstroker.html#joinStyle">joinStyle</a>().</p>
<h3 class="fn"><a name="setMiterLimit"></a>void QPainterPathStroker::setMiterLimit ( <a href="qtglobal.html#qreal-typedef">qreal</a> <i>limit</i> )</h3>
<p>Sets the miter limit of the generated outlines to <i>limit</i>.</p>
<p>The miter limit describes how far from each join the miter join can extend. The limit is specified in units of the currently set width. So the pixelwise miter limit will be <tt>miterlimit * width</tt>.</p>
<p>This value is only used if the join style is <a href="qt.html#PenJoinStyle-enum">Qt::MiterJoin</a>.</p>
<p>See also <a href="qpainterpathstroker.html#miterLimit">miterLimit</a>().</p>
<h3 class="fn"><a name="setWidth"></a>void QPainterPathStroker::setWidth ( <a href="qtglobal.html#qreal-typedef">qreal</a> <i>width</i> )</h3>
<p>Sets the width of the generated outline painter path to <i>width</i>.</p>
<p>The generated outlines will extend approximately 50% of <i>width</i> to each side of the given input path's original outline.</p>
<p>See also <a href="qpainterpathstroker.html#width">width</a>().</p>
<h3 class="fn"><a name="width"></a><a href="qtglobal.html#qreal-typedef">qreal</a> QPainterPathStroker::width () const</h3>
<p>Returns the width of the generated outlines.</p>
<p>See also <a href="qpainterpathstroker.html#setWidth">setWidth</a>().</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%">Copyright &copy; 2008 <a href="trolltech.html">Trolltech</a></td>
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">Qt 4.3.5</div></td>
</tr></table></div></address></body>
</html>
